#ifndef DRAWINGVIEW_H
#define DRAWINGVIEW_H

#include <QGLWidget>

class Document;
class SelectionManager;
class GridHelper;

class DrawingView : public QGLWidget
{
    Q_OBJECT
public:
    explicit DrawingView(QPointer<Document> doc = 0, QWidget *parent = 0);

    QPointer<Document> document() const;
    QPointer<SelectionManager> selectionManager() const;

protected:
    void initializeGL();
    void resizeGL(int w, int h);
    void paintGL();

    void mousePressEvent(QMouseEvent* pEvent);
    void mouseMoveEvent(QMouseEvent* pEvent);
    void mouseReleaseEvent(QMouseEvent* pEvent);
private:
    QPointer<Document> m_doc;
    QPointer<SelectionManager> m_selectionManager;
    QPointer<GridHelper> m_gridHelper;
signals:
    
public slots:
private slots:
    void onElementAdded(QPointer<Element> element);
    void onElementRemoved(QPointer<Element> element);
};

#endif // DRAWINGVIEW_H
